<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ page isELIgnored="false" %>
<%@ include file="/interceptor.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>添加员工</title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function setit(){
            var name=document.getElementById("name").value;
            var sex=document.getElementById("sex").value;
            if(name == null||name=="" ){
                alert("用户名不能为空！");
                return false;
            }else if(sex == null||sex=="" ){
                alert("性别不能为空！");
                return false;
            }else if(confirm("您确定要保存数据吗？")){
                document.forms[0].submit();
        }
        }

        function back() {
            history.go(-1);
        }
    </script>
</head>

<body>
<%-- <%@ include file="login_check.jsp" %> --%>

<form id="myForm" name="myForm" action="emp-add" method="post">
    <div class="action">
        <div class="t">
            添加员工
        </div>
        <div class="pages">
            <table width="90%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td align="right" width="30%">用户名：</td>
                    <td align="left"><input type="text" name="name" id="name"/> <font color="red">*</font></td>
                </tr>
                <tr>
                    <td align="right" width="30%">性别：</td>
                    <td align="left">
                        <select id="sex" name="sex">
                            <option value="">请选择</option>
                            <option value="男" >男</option>
                            <option value="女" >女</option>
                        </select>
                    </td>
                </tr>
                <tr >
                    <td align="center" colspan="2"><br/>
                        <input type="button"  id="save" value="保存数据" onclick="setit();" />
                        <input type="button"  id="re_to" value="返回" onclick="back();" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
</form>
</body>
</html>